/**
 * Created by Administrator on 2018/6/4 0004.
 */
const mongoose = require('mongoose')
const mongoosePaginate = require('mongoose-paginate')
const shops = new mongoose.Schema({
    type: {
        type: String,
        required: true
    },
    imgUri: {
        type: String,
        required: true
    },
    name: {
        type: String,
        required: true
    },
    intro: {
        type: String,
        required: true
    },
    price: {
        type: Number,
        required: true
    },
    create_time: {
        type: Date,
        default: Date.now()/1000
    },
    update_time: {
        type: Date,
        default: Date.now()/1000
    }
}, {
    versionKey: false,
    timeStamp: {createdAt: "create_time", updatedAt: "update_time"}
})
shops.plugin(mongoosePaginate)
const Shops = mongoose.model('Shops', shops)
module.exports = Shops;
